package com.edu.model;

import java.util.HashMap;
import java.util.Map;

public class DeployPrepare {

    private EventVersion eventVersion;
    private DeployParams deployParams;

    public DeployPrepare(EventVersion eventVersion, DeployParams deployParams) {
        this.eventVersion = eventVersion;
        this.deployParams = deployParams;
    }

    private Map<String, Object> processData = new HashMap<>();

    public <T> T getProcessData(String key) {
        return (T) processData.get(key);
    }

    public void putProcessData(String key, Object obj) {
        this.processData.put(key, obj);
    }

    public EventVersion getEventVersion() {
        return eventVersion;
    }

    public void setEventVersion(EventVersion eventVersion) {
        this.eventVersion = eventVersion;
    }

    public DeployParams getDeployParams() {
        return deployParams;
    }

    public void setDeployParams(DeployParams deployParams) {
        this.deployParams = deployParams;
    }

    public static DeployPrepare init(EventVersion eventVersion,
                                     DeployParams deployParams) {
        return new DeployPrepare(eventVersion, deployParams);
    }
}
